import request from '@/utils/request'

const prefix = '/upms/user'

export default {

  create(data) {
    return request({
      url: `${prefix}/create`,
      method: 'post',
      data
    })
  },

  update(data) {
    return request({
      url: `${prefix}/update`,
      method: 'post',
      data
    })
  },

  delete(id) {
    return request({
      url: `${prefix}/delete/${id}`,
      method: 'post'
    })
  },

  resetPassword(id) {
    return request({
      url: `${prefix}/restPassword/${id}`,
      method: 'post'
    })
  },

  page(data) {
    return request({
      url: `${prefix}/page`,
      method: 'post',
      data
    })
  },
  onlineUserList() {
    return request({
      url: `${prefix}/online/list`,
      method: 'get'
    })
  },
  tickoutByToken(token) {
    return request({
      url: `${prefix}/online/tickout/${token}`,
      method: 'post'
    })
  },
  getScopeList(userIdList) {
    return request({
      url: `${prefix}/scope/list`,
      method: 'post',
      data: userIdList
    })
  },
  setScope(data) {
    return request({
      url: `${prefix}/scope/set`,
      method: 'post',
      data: data
    })
  }

}
